package com.zkane.controller;

import com.zkane.remote.ConsumerRemote;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author: 594781919@qq.com
 * @date: 2018/5/8
 */
@RestController
@RequestMapping("/producer")
public class ProducerController {

    @Value("${server.port}")
    private String port;

    @Autowired
    private ConsumerRemote consumerRemote;

    @GetMapping
    public String get() {
        return "Producer Server port: " + port;
    }

    @PostMapping
    public String save() {
        return "保存成功";
    }

    @GetMapping("/test")
    public String test() {
        return consumerRemote.test();
    }
}
